package com.jwiki.app.jkeeper.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jwiki.app.jkeeper.common.data.Response;
import com.jwiki.app.jkeeper.controller.form.SearchForm;
import com.jwiki.app.jkeeper.service.SearchService;

@RestController
@RequestMapping("/search")
public class SearchController extends BaseController {

    @Autowired
    private SearchService searchService;

    @RequestMapping("/getResultByPage")
    public Response getResultByPage(@RequestBody SearchForm form) {
        Response response = getResponse();
        response.setData(searchService.getResultByPage(form));
        response.setSuccess(true);
        return response;
    }

}
